'use strict';
exports = module.exports = function ($scope, $rootScope, $timeout, $alert, $state, $uibModal, $API, $ctrlCache, $go, $rule) {
    $ctrlCache.prolongCache('app.work.tableZH')
    $scope.Rule = $rule;
    $scope.frm = {
        // 表单项: 用户名
        username: '',
    }
    $scope.submitFun = function($submitBtn){
        $scope.From.submitted = true;
        if( $scope.From.$invalid ) {
            $submitBtn.enable();
            $alert.error('请检查提交的信息')
            return
        }
        $timeout(function(){
            $go('app.work.tableZH');
            $submitBtn.enable();
        },1e3)
        return;
    };
    $scope.cancelFun = function(){
        $alert.confirm("是否取消编辑？", function(close){
            $go('app.work.tableZH');
            close();
        })
    };
}